class CreateGroups < ActiveRecord::Migration
  def self.up
    create_table :groups do |t|
      t.integer :category_id
      t.string :name, :limit => 32, :null => false
      t.string :intro, :null => false
      t.string :notice
      t.integer :join
      t.integer :post
      t.integer :visible
      t.integer :verified, :default => 0
      t.integer :rank, :default => 0
      
      t.timestamps
    end
    add_index :groups, :name
  end

  def self.down
    drop_table :groups
  end
end
